class PagesController < CRUDController

  before_filter :login_required, :except => [:index, :show]

  def history
    @page =  Page.find(params[:id])
    @versions = @page.versions
  end

  def create_comment
    @page =  Page.find(params[:id])
    @comment = Comment.new(params[:comment])
    @page.comments << @comment
    current_user.comments << @comment
  end

  protected

  def message
    { :created =>  "Page has been created successful",
      :failed_to_create =>  "Failed to create Page"
    }

  end
end
